﻿package chapter_04_Homework;

public abstract class Work_07_Pet {
	private String name="无名氏";
	private int health=100;
	private int love =0;
	/**
	 * 抽象方法eat（），负责宠物吃饭功能
	 */
	public abstract void eat();
	/**
	 * 有参构造方法
	 * @param name 昵称
	 */
	public Work_07_Pet(){
		
	}
	public Work_07_Pet(String name){
		this.name=name;
		
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getHealth() {
		return health;
	}
	public void setHealth(int health) {
		this.health = health;
	}
	public int getLove() {
		return love;
	}
	public void setLove(int love) {
		this.love = love;
	}
	/**
	 * 输出宠物信息
	 */
	public void print(){
		System.out.println("宠物的自白：\n我的名字叫"+this.name+",健康值是"+this.health+",和主人的亲密度是"+this.love+"。");
	}
}
